<?php defined('BASEPATH') OR exit('No direct script access allowed');
require APPPATH.'/libraries/REST_Controller.php';

class basketitem extends REST_Controller
{
	function get_basket_item_by_id_get()
	{
		if(!$this->get('basket_item_id')) {
			$this->response(array('status'=>"false",
					'message' => 'basket_item_id not provided'), 200);
		}
		$this->load->model('basketitemdao');
		$success = $this->basketitemdao->getbyid($this->get('basket_item_id'));
		$this->response(array('street'=>$success,'status'=> $success ? 'true' : 'false'), 200);
	}

	function get_basket_items_get()
	{
		$this->load->model('basketitemdao');
		$success = $this->basketitemdao->get_all();
		$this->response(array('streets'=>$success,'status'=> $success ? 'true' : 'false'), 200);
	}

	function insert_list_put()
	{
		//$i=$this->put('json_data');
		if(!$this->put('json_data')) {
			$this->response(array('status'=>"false",
					'message' => 'json_data not provided'), 200);
		}
		//$this->load->model('basketitemdao');
		$success = $this->basketitemdao->insert_list($this->put('json_data'));
		//$this->response($a+"sad",200);
		//print_r($this->put('json_data'));
		$this->response(array('list'=>$success,'status'=> $success ? 'true' : 'false'), 200);
		
		//$this->response(array('asd'=>$i),200);
		}
}
?>